<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productNo</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productNo' type='text' name='productNo' id='productNo' data-bv-notempty='true' data-bv-notempty-message='productNo 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productName</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productName' type='text' name='productName' id='productName' data-bv-notempty='true' data-bv-notempty-message='productName 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productDetails</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productDetails' type='text' name='productDetails' id='productDetails' data-bv-notempty='true' data-bv-notempty-message='productDetails 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>classifyIds</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='classifyIds' type='text' name='classifyIds' id='classifyIds' data-bv-notempty='true' data-bv-notempty-message='classifyIds 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>brandId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='brandId' type='text' name='brandId' id='brandId' data-bv-notempty='true' data-bv-notempty-message='brandId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>state</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='state' type='text' name='state' id='state' data-bv-notempty='true' data-bv-notempty-message='state 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>unsoldInventoryAll</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='unsoldInventoryAll' type='text' name='unsoldInventoryAll' id='unsoldInventoryAll' data-bv-notempty='true' data-bv-notempty-message='unsoldInventoryAll 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>undistributedInventoryAll</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='undistributedInventoryAll' type='text' name='undistributedInventoryAll' id='undistributedInventoryAll' data-bv-notempty='true' data-bv-notempty-message='undistributedInventoryAll 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>virtualSales</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='virtualSales' type='text' name='virtualSales' id='virtualSales' data-bv-notempty='true' data-bv-notempty-message='virtualSales 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>sales</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='sales' type='text' name='sales' id='sales' data-bv-notempty='true' data-bv-notempty-message='sales 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productPhotoId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productPhotoId' type='text' name='productPhotoId' id='productPhotoId' data-bv-notempty='true' data-bv-notempty-message='productPhotoId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>shufflingFigureIds</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='shufflingFigureIds' type='text' name='shufflingFigureIds' id='shufflingFigureIds' data-bv-notempty='true' data-bv-notempty-message='shufflingFigureIds 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>detailsFigurePathIds</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='detailsFigurePathIds' type='text' name='detailsFigurePathIds' id='detailsFigurePathIds' data-bv-notempty='true' data-bv-notempty-message='detailsFigurePathIds 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>viewedTimes</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='viewedTimes' type='text' name='viewedTimes' id='viewedTimes' data-bv-notempty='true' data-bv-notempty-message='viewedTimes 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>sysUserId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='sysUserId' type='text' name='sysUserId' id='sysUserId' data-bv-notempty='true' data-bv-notempty-message='sysUserId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>updater</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='updater' type='text' name='updater' id='updater' data-bv-notempty='true' data-bv-notempty-message='updater 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productNote</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productNote' type='text' name='productNote' id='productNote' data-bv-notempty='true' data-bv-notempty-message='productNote 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>productRemark</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='productRemark' type='text' name='productRemark' id='productRemark' data-bv-notempty='true' data-bv-notempty-message='productRemark 不能为空'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='tswProductList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="add()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		function add() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'post',
				url : '/tswProducts',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("添加成功", {shift: -1, time: 1000}, function(){
                        location.href = "tswProductList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
